import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import axios from "axios";
import "./css/common.css";

const app = createApp(App);
axios.interceptors.request.use((config) => {
  config.headers.Authorization = window.sessionStorage.getItem("Token");
  return config;
});
app.config.globalProperties.$http = axios;
app.use(router).use(ElementPlus).mount("#app");
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
